//
//  HYcellForSongsMenu.m
//  TTLestening
//
//  Created by dllo on 16/3/24.
//  Copyright © 2016年 dilo. All rights reserved.
//

#import "HYcellForSongsMenu.h"
#import "HYModelForSongsMenu.h"
#import <SDWebImage/UIImageView+WebCache.h>

@implementation HYcellForSongsMenu

#pragma mark - init
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
    
        [self createSubViews];
    }
    return self;
}

#pragma mark - createSubViews
- (void)createSubViews {
    
    self.imageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imageView];
    
    self.labelForTitle = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelForTitle];
}

#pragma mark - layout
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
    
    self.labelForTitle.frame =CGRectMake(0, self.imageView.frame.size.height, self.bounds.size.width, 40);
    
}

- (void)passMoldel:(HYModelForSongsMenu *)model {
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.pic_url]];
    
    self.labelForTitle.text = model.title;
}





@end
